/*
 *    Copyright (c) 2018-2025, lengleng All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: lengleng (wangiegie@gmail.com)
 */

package com.pig4cloud.pigx.contract.app;

import com.pig4cloud.pigx.common.core.util.R;
import com.pig4cloud.pigx.common.log.annotation.SysLog;
import com.pig4cloud.pigx.contract.dto.AppContractStopOrderNewDTO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 止盈止损委托表
 *
 * @since 2022-08-11 10:08:59
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/app/stoporder")
@Api(value = "contractstoporder", tags = "app止盈止损管理")
public class AppContractStopOrderController {

    /**
     * 撤销单个止盈止损
     *
     * @param id id
     * @return {@link R}
     * @since 2022/9/3 17:34
     */
    @SysLog("撤销单个止盈止损")
    @PostMapping("/cancel")
    @ApiOperation(value = "撤销单个止盈止损", notes = "撤销单个止盈止损")
    public R cancel(@RequestBody Long id) {
        return R.ok();
    }

    /**
     * 撤销当前用户全部止盈止损
     *
     * @return {@link R}
     * @since 2022/9/3 17:36
     */
    @SysLog("撤销当前用户全部止盈止损")
    @PostMapping("/cancel/all")
    @ApiOperation(value = "撤销当前用户全部止盈止损", notes = "撤销当前用户全部止盈止损")
    public R cancelAll() {
        return R.ok();
    }

    /**
     * 新建止盈止损
     *
     * @param dto dto
     * @return {@link R}
     * @since 2022/9/6 20:43
     */
    @SysLog("新建止盈止损")
    @PostMapping
    @ApiOperation(value = "新建止盈止损", notes = "新建止盈止损")
    public R add(@Validated @RequestBody AppContractStopOrderNewDTO dto) {
        return R.ok();
    }
}
